import time
import unittest

from selenium.webdriver.common.by import By

from autoframe.common.base import Base
from common.functions import open_browser


class LoginPage(Base):
    def get_index(self):
        self.get('http://139.129.26.163/')
        self.click((By.LINK_TEXT,'请登录'))

    def input_username(self,username):
        self.send_keys((By.NAME,'username'),username)

    def input_password(self,password):
        self.send_keys((By.NAME,'password'),password)

    def login_button(self):
        self.click((By.CLASS_NAME,'us_Submit'))
    # def input_username(self,username):
if __name__ == '__main__':
    lp=LoginPage(browser=open_browser())
    lp.get_index()
    lp.input_username('srx')
    lp.input_password('123456')
    lp.login_button()
    time.sleep(2)
    lp.quit()





